import Vue from 'vue'
import Router from 'vue-router'
import AdminAccountVue from '../components/admin/AdminAccount.vue'
import AdminInfoVue from '../components/admin/AdminInfo.vue'
import AdminLoginVue from '../components/admin/AdminLogin.vue'
import AdminMainVue from '../components/admin/AdminMain.vue'
import CarVue from '../components/admin/Car.vue'
import ProductVue from '../components/admin/Product.vue'
import adminchatVue from '../components/admin/adminchat.vue'
import StoreAdminVue from '../components/admin/StoreAdmin.vue'
import OrderVue from '../components/admin/Order.vue'
import userlogin from '../components/user/userlogin.vue'
import userchat from '../components/user/userchat.vue'
import usermain from '../components/user/usermain.vue'
import adminchat from '../components/admin/adminchat.vue'
import useraccount from '../components/admin/userAccount.vue'
import store from '../components/admin/store.vue'
import ScoreStoreVue from '../components/admin/ScoreStore.vue'
import AdminHistoryVue from '../components/admin/AdminHistory.vue'
import ticket from '../components/admin/Ticket.vue'
import ServiceVue from '../components/admin/Service.vue'
Vue.use(Router)

export default new Router({
  mode: "history",
  routes: [{
      path: '/',
      redirect: "/adminlogin",
    },
    {
        path: '/adminlogin',
        name: 'AdminLogin',
        component: AdminLoginVue
      },
    {
      path: '/adminlogin',
      name: 'AdminLogin',
      component: AdminLoginVue
    },
 {
      path: '/userlogin',
      name: 'userlogin',
      component: userlogin
    },
    {
      path: "/adminmain",
      component: AdminMainVue,
      children: [ //配置子路由 数组
        {
          path: "/adminaccount",
          component: AdminAccountVue,
        },
        {
          path: "/admininfo",
          component: AdminInfoVue,
        },
        {
          path: "/car",
          component: CarVue,
        },
        {
          path: "/product",
          component: ProductVue,
        },
        {
          path: "/adminchat",
          component: adminchatVue,
        },
        {
          path: "/storeadmin",
          component: StoreAdminVue,
        },
        {
          path: "/order",
          component: OrderVue,
        },
        {
          path: "/scorestore",
          component: ScoreStoreVue,
        },
        {
          path: "/useraccount",
          component: useraccount,
        },
        {
          path: "/adminHistory",
          component: AdminHistoryVue,
        },
        {
          path: "/store",
          component: store,
        },
        {
          path: "/ticket",
          component: ticket,
        },
        {
          path: "/service",
          component: ServiceVue,
        },
      ]
    },
        {
          path: "/usermain",
          component: usermain,
          children: [
            {
              path: "/userchat",
              component: userchat,
            },
          ]
        }
  ]
})
